package suery.syntax;

import java.util.Queue;
import java.util.Set;

import suery.ComponentTreeNode;

/**
 * '/' in expression means to get all the children of the component.
 * 
 * @author Jeky
 * 
 */
public class GetChildrenParser implements TokenParser {

    @Override
    public void parse(Queue<String> tokenQueue,
            Set<ComponentTreeNode> parents,
            Set<ComponentTreeNode> results) {
        for (ComponentTreeNode p : parents) {
            for (ComponentTreeNode child : p.getChildren()) {
                results.add(child);
            }
        }
    }
}
